package com.xuanyuan.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.util.Date;

/*
用户实体类
 */
@Data
public class User {
    private Integer id;

    @NotBlank(message = "用户名不能为空")
    @Size(min = 0, max = 20, message = "用户名长度不能超过20个字符")
    private String username;

    @Size(min = 0, max = 30, message = "昵称长度不能超过30个字符")
    private String nickname;

    @Size(min = 0, max = 20, message = "密码长度不能超过20个字符")
    private String password;

    private String status;

    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone = "GMT+8")
    private Date updateTime;
}
